﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZLCMS.Business;
using ZLCMS.Business.DwzFrame;
using NHibernate;

namespace ZLCMS.Web.SystemManage.Basics.MemberCard
{
    public partial class Delete : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                FrameHelper framePage = new FrameHelper(this);

                using (ISession session = DotNet.Common.NHibernateUtil.SessionFactoryHelper.CreateSession())
                {
                    try
                    {
                        String id = Request["uid"];
                        session.Delete(new ZLCMS.Data.Model.MemberCard() { Id = Request["uid"] });
                        session.Flush();
                    }
                    catch (System.Exception ex)
                    {
                        framePage.Alert(new ReturnCode() { statusCode = 300, message = "操作失败-" + ex.Message });
                        return;
                    }
                }

                framePage.Alert(new ReturnCode() { statusCode = 200, message = "操作成功!", navTabId = framePage.NavTabId });
            }
        }
    }
}
